package com.sheyu.mall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sheyu.common.utils.PageUtils;
import com.sheyu.mall.member.entity.MemberEntity;
import com.sheyu.mall.member.exception.PhoneException;
import com.sheyu.mall.member.exception.UsernameException;
import com.sheyu.mall.member.vo.MemberLoginVo;
import com.sheyu.mall.member.vo.MemberRegistVo;
import com.sheyu.mall.member.vo.SocialUser;

import java.util.Map;

/**
 * 会员
 *
 * @author sheyu
 * @email sheyu@XXX.com
 * @date 2020-07-27 14:20:56
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 用户注册
     *
     * @param memberRegistVo
     */
    void saveMemberRegist(MemberRegistVo memberRegistVo);

    /**
     * 判断邮箱是否重复
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws PhoneException;

    /**
     * 判断用户名是否重复
     * @param userName
     * @return
     */
    void checkUserNameUnique(String userName) throws UsernameException;

    /**
     * 用户登陆
     * @param vo
     * @return
     */
    MemberEntity login(MemberLoginVo vo);

    MemberEntity login(SocialUser socialUser);
}

